/*
 * main.cpp
 *
 *  Created on: 2011-5-2
 *      Author: aeolus
 */
#include "TEight.h"
#include "CommonBFS.cpp"
#include "NearestBFS.cpp"
#include "LeaestUnPostionBFS.cpp"
#include <fstream>
#include <time.h>
using namespace std;
int main()
{
	ifstream ifile("input.txt");
	time_t tm;
	int temp;
	int origin[Num+1];
	int target[Num+1]={0,1,2,3,8,0,4,7,6,5};//目标状态
	int i=1;
	while(ifile >> temp)
	{
		origin[i] = temp;
		i++;
	}
	tm = clock();
	CommonBFS t(origin,target);
	t.search();
	cout<<"算法CommonBFS用时："<<((float)(clock() - tm) / CLOCKS_PER_SEC )<<"s"<<endl;

	tm = clock();
	NearestBFS nbfs(origin,target);
	nbfs.search();
	cout<<"算法NearestBFS用时："<<((float)(clock() - tm) / CLOCKS_PER_SEC )<<"s"<<endl;


	tm = clock();
	LeaestUnPostionBFS lupbfs(origin,target);
	lupbfs.search();
	cout<<"算法LeaestUnPostionBFS用时："<<((float)(clock() - tm) / CLOCKS_PER_SEC )<<"s"<<endl;
	return 0;
}
